<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="@{include} :: header"></head>
<style>
	.layui-form-item{
		margin-bottom: 10px;
	}
</style>
<body>
<div class="layuimini-container">
	<div class="layuimini-main">
		<div class="layui-row">
			<form class="layui-form layui-form-pane" id="signupForm">
				<input id="userId" name="userId" type="hidden">
				<input id="userType" name="userType" type="hidden" th:value="${user.userType}">
				<input id="localUserId" name="localUserId" type="hidden" th:value="${userLocal.roleId}">
				<input name="shopId" type="hidden" th:value="${shop_id}" th:if="${local_user_type >= 4}">
				<input name="pianquId" type="hidden" th:value="${userLocal.pianquId}" th:if="${local_user_type >= 3}">
				<input name="pianquUserId" type="hidden" th:value="${userLocal.pianquUserId}" th:if="${local_user_type >= 3}">
				<input name="jituanId" type="hidden" th:value="${userLocal.jituanId}" th:if="${local_user_type >= 3}">
				<input name="groupId" type="hidden" th:value="${userLocal.groupId}" th:if="${local_user_type >= 3}">
				<div class="layui-form-item">
					<label class="layui-form-label">姓名：</label>
					<div class="layui-input-block">
						<input id="name" name="name" class="layui-input" type="text" autocomplete="off">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">用户名：</label>
					<div class="layui-input-block">
						<input id="username" name="username" class="layui-input" type="text" autocomplete="off">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">密码：</label>
					<div class="layui-input-block">
						<input id="password" name="password" class="layui-input" type="password" autocomplete="off">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">手机号：</label>
					<div class="layui-input-block">
						<input id="mobile" name="mobile" class="layui-input" type="text" autocomplete="off">
					</div>
				</div>

<!--				<div class="layui-form-item" th:classappend="${userType eq 4 || userLocal.roleId eq 5}  ? '' : 'layui-hide'">-->
<!--					<label class="layui-form-label">能否车辆叫号:</label>-->
<!--					<div class="layui-input-block">-->
<!--						<select id="isCall" name="isCall" class="layui-input" >-->
<!--							<option value="0" >否</option>-->
<!--							<option value="1" >是</option>-->
<!--						</select>-->
<!--					</div>-->
<!--				</div>-->
				<div class="layui-form-item">
					<label class="layui-form-label">状态:</label>
					<div class="layui-input-block">
						<label class="radio-inline">
							<input type="radio" name="status" value="1" checked/> 正常
						</label>
						<label class="radio-inline">
							<input type="radio" name="status" value="0" /> 禁用
						</label>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">角色:</label>
					<div class="layui-input-block">
						<select id="roleId" name="roleId" class="layui-input" lay-filter="roleId">
							<option value="">请选择角色</option>
							<th:block th:each="role : ${roleList}">
								<option th:value="${role.roleId}" th:text="${role.roleName}"
										th:selected="${user.roleId eq role.roleId}"></option>
							</th:block>
						</select>
					</div>
				</div>

				<div class="layui-form-item" th:classappend="${userType eq 6}  ? '' : 'layui-hide'">
					<label class="layui-form-label">开启微信推送:</label>
					<div class="layui-input-block">
						<label class="radio-inline">
							<input type="radio" name="isSendMsg" value="1" checked/> 开启
						</label>
						<label class="radio-inline">
							<input type="radio" name="isSendMsg" value="0" /> 关闭
						</label>
					</div>
				</div>

				<div class="layui-form-item" th:classappend="${add_user_type  == 2}  ? '' : 'layui-hide'">
					<label class="layui-form-label">所属集团</label>
					<div class="layui-input-block">
						<select id="groupId" name="groupId" class="layui-input">
							<option value="">所属集团</option>
							<th:block th:each="d : ${groups}">
								<option th:value="${d.id}" th:text="${d.groupName}" th:selected="${user.groupId eq d.id}"></option>
							</th:block>
						</select>
					</div>
				</div>

				<div class="layui-form-item" th:classappend="${add_user_type >= 3 && local_user_type <= 3 && add_user_type != 10}  ? '' : 'layui-hide'">
					<label class="layui-form-label">所属片区</label>
					<div class="layui-input-block">
						<select id="pianquId" name="pianquId" class="layui-input" lay-search="" lay-filter="pianquId">
							<option value="">所属片区</option>
							<th:block th:each="d : ${pianqus}">
								<option th:value="${d.id}" th:text="${d.pianquName}" th:selected="${user.pianquId eq d.id}"></option>
							</th:block>
						</select>
					</div>
				</div>

				<div class="layui-form-item" th:classappend="${add_user_type > 3 && local_user_type <= 2  && add_user_type != 10}  ? '' : 'layui-hide'">
					<label class="layui-form-label">所属片区管理员</label>
					<div class="layui-input-block">
						<select id="pianquUserId" name="pianquUserId" class="layui-input" lay-search="" lay-filter="pianquUserId">
							<option value="">所属片区管理员</option>
							<th:block th:each="d : ${users}">
								<option th:value="${d.userId}" th:text="${d.name}" th:selected="${user.pianquUserId eq d.userId}"></option>
							</th:block>
						</select>
					</div>
				</div>
				<div class="layui-form-item" th:classappend="${add_user_type > 3 && local_user_type != 4 && add_user_type !=10}  ? '' : 'layui-hide'">
					<label class="layui-form-label">所属企业</label>
					<div class="layui-input-block">
						<select id="shopId" name="shopId" lay-search="" class="layui-input">
							<option value="">所属企业</option>
							<th:block th:each="d : ${shops}">
								<option th:value="${d.id}" th:text="${d.shopName}" th:selected="${user.shopId eq d.id}"></option>
							</th:block>
						</select>
					</div>
				</div>
				<div class="layui-form-item town-user-div" th:classappend="${user.userType eq 10 && (userLocal.townId == null || userLocal.townId == 0)}  ? '' : 'layui-hide'">
					<label class="layui-form-label">所属乡镇</label>
					<div class="layui-input-block">
						<select id="townId" name="townId" class="layui-input" lay-filter="ctownId" >
							<option value="" >所属乡镇</option>
							<th:block th:each="t : ${townsList}">
								<option th:value="${t.id}" th:text="${t.townName}" th:selected="${user.townId eq t.id}"></option>
							</th:block>
						</select>
					</div>
				</div>
				<div class="layui-form-item company-user-div" th:classappend="${add_user_type == 10 && (userLocal.shopId == null || userLocal.shopId == 0) }  ? '' : 'layui-hide'">
					<label class="layui-form-label">所属企业</label>
					<div class="layui-input-block">
						<select id="shopId" name="shopId" lay-search="" class="layui-input" lay-filter="shopId">
							<option value="">所属企业</option>
							<th:block th:each="c : ${shopList}">
								<option th:value="${c.id}" th:text="${c.shopName}" th:selected="${user.shopId eq c.id}"></option>
							</th:block>
						</select>
					</div>
				</div>
				<div class="layui-form-item dept-user-div" th:classappend="${add_user_type  == 10 && user.roleId != 13  && local_user_type == 10}  ? '' : 'layui-hide'">
					<label class="layui-form-label" >所属部门</label>
					<div class="layui-input-block">
						<select id="deptId" name="deptId" class="layui-input">
							<option value="">所属部门</option>
							<th:block th:each="d : ${deptList}">
								<option th:value="${d.id}" th:text="${d.name}" th:selected="${user.deptId eq d.id}"></option>
							</th:block>
						</select>
					</div>
				</div>

				<div class="layui-form-item certificate-div" th:classappend="${add_user_type  == 10}  ? '' : 'layui-hide'">
					<label class="layui-form-label">电焊工证书：</label>
					<div class="layui-input-block">
						<input id="certificateNum" name="certificateNum" class="layui-input" type="text" />
					</div>
				</div>

				<div class="layui-form-item certificate-div" th:classappend="${add_user_type  == 10}  ? '' : 'layui-hide'">
					<label class="layui-form-label">高空作业证：</label>
					<div class="layui-input-block">
						<input id="highCertNum" name="highCertNum" class="layui-input" type="text" />
					</div>
				</div>

				<div class="layui-form-item">
					<div style="text-align: center;margin-top: 20px">
						<button type="submit" class="layui-btn layui-btn-normal" >提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/appjs/sys/user/add.js}"></script>
<script type="text/javascript" th:src="@{/js/appjs/sys/user/common_user.js}"></script>
</body>
</html>
